//1,1,2,3,5,8,13输入第n个数是多少
/*
function fibonacci(n){
   if(n<=2)return 1
    var arr=[1,1]
    let i=n-2
    while (i>0){
       let current=arr[arr.length-2]+arr[arr.length-1]
        arr.push(current)
        i--
    }
   return arr[arr.length-1]
}
*/
function fb1(count) {
    function fn(count, curr = 1, next = 1) {
        if (count == 1) {
            return curr
        } else {
            return fn(count - 1, next, curr + next)
        }
    }
    return fn(count)
}

console.log(fb1(2))